/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.test.entity;

import org.hibernate.validator.constraints.Length;

import com.kaaction.common.persistence.DataEntity;
import com.kaaction.common.utils.StringUtils;

/**
 * 虎丘婚纱城运营商品Entity
 * @author ZengBiao
 * @version 2017-06-20
 */
public class HqhscProduct extends DataEntity<HqhscProduct> {
	
	private static final long serialVersionUID = 1L;
	private String no;		// 序号
	private String areaId;		// 区域
	private String subAreaId;		// 子区域
	private String classifyName;		// 业态
	private String name;		// 货品明细
	private String code;		// 公安编号
	private String num;		// 数量
	private String price;		// 精选价
	private String pic;		// 图片全路径
	private String picRaw;
	private String picThumb;		// 缩略图全路径
	private String brand;		// 品牌
	private String note;		// 备注
	private String sort;		// 排序
	
	public HqhscProduct() {
		super();
	}

	public HqhscProduct(String id){
		super(id);
	}

	@Length(min=0, max=10, message="序号长度必须介于 0 和 10 之间")
	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}
	
	@Length(min=0, max=3, message="区域长度必须介于 0 和 3 之间")
	public String getAreaId() {
		return areaId;
	}

	public void setAreaId(String areaId) {
		this.areaId = areaId;
	}
	
	public String getSubAreaId() {
		return subAreaId;
	}

	public void setSubAreaId(String subAreaId) {
		this.subAreaId = subAreaId;
	}
	
	@Length(min=0, max=64, message="业态长度必须介于 0 和 64 之间")
	public String getClassifyName() {
		return classifyName;
	}

	public void setClassifyName(String classifyName) {
		this.classifyName = classifyName;
	}
	
	@Length(min=1, max=200, message="货品明细长度必须介于 1 和 200 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=64, message="公安编号长度必须介于 0 和 64 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=0, max=5, message="数量长度必须介于 0 和 5 之间")
	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}
	
	@Length(min=0, max=10, message="精选价长度必须介于 0 和 10 之间")
	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}
	
	@Length(min=0, max=100, message="图片全路径长度必须介于 0 和 100 之间")
	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}
	
	public String getPicThumb() {
		if(!StringUtils.isBlank(pic))
			return pic.substring(1).replace("/files/", "/_thumbs/files/");
		else return "";
	}

	public void setPicThumb(String picThumb) {
		this.picThumb = picThumb;
	}
	
	@Length(min=0, max=64, message="品牌长度必须介于 0 和 64 之间")
	public String getBrand() {
		return brand;
	}

	public void setBrand(String brand) {
		this.brand = brand;
	}
	
	@Length(min=0, max=200, message="备注长度必须介于 0 和 200 之间")
	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}
	
	@Length(min=0, max=11, message="排序长度必须介于 0 和 11 之间")
	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getPicRaw() {
		if(!StringUtils.isBlank(pic))
			return pic.substring(1);
		else return "";
	}

	public void setPicRaw(String picRaw) {
		this.picRaw = picRaw;
	}
	
}